
 <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@page language="java" %>

<c:forEach var="p" items="${cartDetail}">
<form action="updatecart.do" method="get" accept-charset="utf-8">
<input type="hidden" value="${p.idcartdetail}" name="tbidcartdetail"/>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<ul class="shopping-cart-table">

				<li>
					<div class="img-box"><img src="<c:url value="${p.product.linkImage}" />" title="" alt="" /></div>
				</li>
				<li>
					<div class="remove-item-btn"><a href="removecart.do?idcartdetail=${p.idcartdetail}" title="Remove"><img src="<c:url value="/images/delete_item_btn.png" />" title="Remove" alt="Remove" /></a></div>
					<div class="pro-name">${p.product.productname}</div>
					<a href="javascript:void(0)" title="" class="prev add"><img src="images/qty_prev.png" title="" alt="" />‹</a>
					<input type="text" value="${p.quantity}" maxlength="12" id="qty" class="input-text qty" name="tbquality" readonly="true"/>
					<a href="javascript:void(0)" title="" class="next dec add"><img src="images/qty_next.png" title="" alt="" />›</a>
					<script type="text/javascript">
								jQuery(document).ready(function(){
									jQuery(".ajax").colorbox();
								});	
                            	jQuery(function() {
									jQuery(".add").click(function() {
										var jQueryadd = jQuery(this);
										var oldValue = jQueryadd.parent().find("input").val();
										var newVal = 0;
									
										if (jQueryadd.text() == "›") {
										   newVal = parseFloat(oldValue) + 1;
										  // AJAX save would go here
										} else {
										  // Don't allow decrementing below zero
										  if (oldValue >= 1) {
											  newVal = parseFloat(oldValue) - 1;
											  // AJAX save would go here
										  }
										  if(oldValue == 0){
											  newVal = parseFloat(oldValue);
											  }
										}
										jQueryadd.parent().find("input").val(newVal);
									});
									
								
								});
                            </script>
					
					<div class="pro-price"><fmt:formatNumber type="currency" currencySymbol="$" value="${p.product.price}"/></div>
				</li>
				
				<li>
				<div class="update-shopping-cart">
					<input class="colors-btn" type="submit"value="Update" title="Update" />
					</div>
				</li>
			</ul>
			</form>
			<div class="show-option-block"><a href="#" title="Show Options"></a></div>
</c:forEach>
			
			<div class="shopping-cart-totals">
				<div class="subtotal-row"><div class="left">Subtotal</div><div class="right"><fmt:formatNumber type="currency" currencySymbol="$" value="${TongTien}"/></div></div>
				<div class="grand-row"><div class="left">Grand  Total</div><div class="right"><fmt:formatNumber type="currency" currencySymbol="$" value="${TongTien}"/></div></div>
				<ul class="checkout-types">
					<li><a href="checkout.do"><button class="colors-btn" title="Proceed to Checkout">Thanh Toan</button></a></li>
				</ul>
			</div>
